#include <map>
#include <vector>

using namespace std;

class Solution
{
public:
    int findRepeatNumber(vector<int> &nums)
    {
        map<int, int> m;
        for (auto e : nums)
        {
            if (m[e])
            {
                return e;
            }
            ++m[e];
        }
        return 0;
    }
};